﻿using FluentValidation;
using Nop.Admin.Models.Logistics;
using Nop.Core.Domain.Customers;
using Nop.Services.Localization;

namespace Nop.Admin.Validators.Logistics
{
    public class LogisticsLocationValidator : AbstractValidator<LogisticsLocationModel>
    {
        public LogisticsLocationValidator(ILocalizationService localizationService)
        {
            RuleFor(x => x.Rank)
                .NotEmpty()
                .LessThanOrEqualTo(LogisticsLocationModel.ReservedRankNumber)
                .WithMessage(localizationService.GetResource("Admin.Logistics.LogisticsLocation.Fields.Rank.Invalid"));
        }
    }
}
